package com.l024.easyandroidlib.http.ssl;

import java.security.SecureRandom;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;

/**
 * @author wu_ming_zhi_bei
 * @date 2021/8/10 15:08
 * @Notes
 */
public class MySSLSocketFactory{
  public static SSLSocketFactory createSSLSocketFactory() {
    SSLSocketFactory ssfFactory = null;
    try {
      SSLContext sc = SSLContext.getInstance("TLS");
      sc.init(null, new TrustManager[]{new TrustAllCerts()}, new SecureRandom());
      ssfFactory = sc.getSocketFactory();
    } catch (Exception e) {
    }
    return ssfFactory;
  }
}